﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Views.Account
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            
        }

        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            try
            {
                string uname = LoginUser.UserName.ToLower().Trim(); //Get the username from the control
                string password = LoginUser.Password; //get the Password from the control
                if (uname == "licitaweb" && password == "123")
                {
                    e.Authenticated = true;
                    Response.Redirect("~/Default.aspx");
                }
                else
                {
                    e.Authenticated = false;
                }
            }
            catch (Exception)
            {
                e.Authenticated = false;
            }
        }
    }
}
